package search;
/**
 * Write a description of class UndirectedGraph here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public abstract class UndirectedGraph<N extends GraphNode<?>, E extends GraphEdge<?, N>> extends Digraph<N,E>
{
    public UndirectedGraph() {
        super();
    }
    
    public void addEdge(E edge)
    {
        if (!edges.contains(edge)) {
            edges.add(edge);
            addNode(edge.getNode1());
            addNode(edge.getNode2());
            N node = edge.getNode1();
            //nodeEdges.get(node).add(edge);
            associateEdgeWithNode(edge,node);
            node = edge.getNode2();
            //nodeEdges.get(node).add(edge);
            associateEdgeWithNode(edge,node);
        }
    }
}
